home *** CD-ROM | disk | FTP | other *** search
- /*=========================== TargetActionView.h ============================*/
- // Written by Dale Amon, copyright 1994 by Genesis Project, Ltd.
- // Version 0.8. All rights reserved.
- //
- // This notice may not be removed from this source code.
- //
- // This object is included in the MiscKit by permission from the author
- // and its use is governed by the MiscKit license, found in the file
- // "LICENSE.rtf" in the MiscKit distribution. Please refer to that file
- // for a list of all applicable permissions and restrictions.
- //
-
- /* Abstract superclass that impliments a target action paradeigm for Views.
- This is not quite the same as the Control Class because there is no
- "value". It allows the view to accept keyboard and mouse events and convert
- them into target/action messages (potentially using a responder chain).
- Note that events in the actionMask will only be recieved if the
- corresponding events are enabled in the window's event mask.
-
- HISTORY
- 1-Aug-93 Dale Amon at GPL
- Created.
-
- */
-
- #define MISC_TAVIEW_VERSION_ID 0.8
-
- @interface MiscTargetActionView:View
- { BOOL firstMouse; /* set if view is to respond to
- a first mouse down */
- int actionMask; /* events that will trigger
- the target/action */
- NXEvent *actionEvent; /* event which caused the current
- firing of a target/action */
- id target; /* target for events */
- SEL action; /* action to be sent upon event */
-
- BOOL debug; /* debug trace flag */
- }
-
- + initialize;
-
- - initFrame: (const NXRect *) theRect;
-
- - (BOOL)acceptsFirstResponder;
- - (BOOL)acceptsFirstMouse;
-
- - setFirstResponder;
- - setFirstMouse: (BOOL) flg;
-
- - (int)addToActionMask: (int)newActions;
- - (int)actionMask;
- - (int)removeFromActionMask: (int)oldActions;
- - (int)setActionMask: (int)newMask;
-
- - setAction: (SEL) theAction;
- - setTarget: theTarget;
- - (SEL) action;
- - target;
- - (const NXEvent *) actionEvent;
-
- - flagsChanged: (NXEvent *)theEvent;
- - keyDown: (NXEvent *)theEvent;
- - keyUp: (NXEvent *)theEvent;
- - mouseDown: (NXEvent *)theEvent;
- - mouseDragged: (NXEvent *)theEvent;
- - mouseEntered: (NXEvent *)theEvent;
- - mouseExited: (NXEvent *)theEvent;
- - mouseMoved: (NXEvent *)theEvent;
- - mouseUp: (NXEvent *)theEvent;
- - rightMouseDown: (NXEvent *)theEvent;
- - rightMouseDragged: (NXEvent *)theEvent;
- - rightMouseUp: (NXEvent *)theEvent;
-
- - setDebug: (BOOL) flg;
- - (BOOL) debug;
- - toggleDebug: sender;
-
- @end
-